<template>
	<view class="goods_list">
		<view @click="navigator(item.id)" class="goods_item" v-for="item in goods" :key="item.id">
			<image :src="item.img_url"></image>
			<view class="price">
				<text>￥{{item.sell_price}}</text>
				<text>￥{{item.market_price}}</text>
				<text>销量：{{item.stock_quantity}}</text>
			</view>
			<view class="goods_name">
				{{item.title}}
			</view>
		</view>
		
	</view>
</template>

<script>
	export default{
		// 子类Props
		props:['goods'],
		methods:{
			navigator(id){
				console.log("goodsListID",id)
				this.$emit('goodsItemClick',id)
			}
		}
	}
</script>

<style lang="scss">
	.goods_list{
		padding: 0 15rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		.goods_item{
			background: #FFFFFF;
			width: 355rpx;
			margin: 10rpx 0;
			image{
				margin: 0 auto;
				display: block;
				width: 80%;
				height: 150px;
				
			}
			.price{
				color:#b50e03;
				font-size: 30rpx;
				text:nth-child(2){
					color: #ccc;
					font-size: 25rpx;
					margin-left: 17rpx;
					text-decoration: line-through;
				}
				text:nth-child(3){
					color: #ccc;
					font-size: 25rpx;
					margin-left: 17rpx;
					
				}
			}
			.goods_name{
				font-size: 33rpx;
				line-height: 50rpx;
				padding:15rpx ;
			}
		}
	}
</style>
